package com.mz.ozy.adapter;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.mz.ozy.R;
import com.mz.ozy.bean.OrderListBean;
import com.mz.ozy.utils.Utils;

import java.util.List;

/**
 *
 */

public class MySellKtAdapter extends BaseQuickAdapter<OrderListBean.PageBean.PageItemsBean, BaseViewHolder> {
    private int type;

    public MySellKtAdapter(List<OrderListBean.PageBean.PageItemsBean> data, int type) {
        super(R.layout.item_my_sell_kt, data);
        this.type = type;
    }

    @Override
    protected void convert(BaseViewHolder helper, OrderListBean.PageBean.PageItemsBean item) {
        if (type == 0) {
            switch (item.getType()) {
                case 0:
                    helper.setText(R.id.tv_operate_type, "签到奖励");
                    break;
                case 1:
                    helper.setText(R.id.tv_operate_type, "购买商品奖励");
                    break;
                case 2:
                    helper.setText(R.id.tv_operate_type, "推荐会员奖励");
                    break;
                case 3:
                    helper.setText(R.id.tv_operate_type, "退款");
                    break;
                case 4:
                    helper.setText(R.id.tv_operate_type, "后台调整");
                    break;
                case 5:
                    helper.setText(R.id.tv_operate_type, "购买VIP礼包奖励");
                    break;
                case 6:
                    helper.setText(R.id.tv_operate_type, "购买商品");
                    break;
                case 7:
                    helper.setText(R.id.tv_operate_type, "奖励结算");
                    break;
                case 8:
                    helper.setText(R.id.tv_operate_type, "退款扣除");
                    break;
                case 9:
                    helper.setText(R.id.tv_operate_type, "定食宅送支付");
                    break;
            }
        } else if (type == 1) {
            switch (item.getType()) {
                case 0:
                    helper.setText(R.id.tv_operate_type, "购买VIP礼包");
                    break;
                case 1:
                    helper.setText(R.id.tv_operate_type, "购买商品奖励");
                    break;
                case 2:
                    helper.setText(R.id.tv_operate_type, "退款");
                    break;
                case 3:
                    helper.setText(R.id.tv_operate_type, "后台调整");
                    break;
                case 4:
                    helper.setText(R.id.tv_operate_type, "退款扣除");
                    break;
            }
        } else {
            switch (item.getType()) {
                case 0:
                    helper.setText(R.id.tv_operate_type, "购买VIP礼包");
                    break;
                case 1:
                    helper.setText(R.id.tv_operate_type, "购买商品");
                    break;
                case 2:
                    helper.setText(R.id.tv_operate_type, "奖励结算");
                    break;
                case 3:
                    helper.setText(R.id.tv_operate_type, "充值");
                    break;
                case 4:
                    helper.setText(R.id.tv_operate_type, "提现");
                    break;
                case 5:
                    helper.setText(R.id.tv_operate_type, "退款");
                    break;
                case 6:
                    helper.setText(R.id.tv_operate_type, "后台调整");
                    break;
                case 7:
                    helper.setText(R.id.tv_operate_type, "提现审核失败");
                    break;
                case 8:
                    helper.setText(R.id.tv_operate_type, "礼尚往来运费");
                    break;
                case 9:
                    helper.setText(R.id.tv_operate_type, "定食宅送支付");
                    break;
                case 10:
                    helper.setText(R.id.tv_operate_type, "有机家宴支付");
                    break;
                case 11:
                    helper.setText(R.id.tv_operate_type, "报单奖励");
                    break;
                case 12:
                    helper.setText(R.id.tv_operate_type, "配送奖励");
                    break;
                case 13:
                    helper.setText(R.id.tv_operate_type, "直推奖");
                    break;
                case 14:
                    helper.setText(R.id.tv_operate_type, "小团队奖");
                    break;
                case 15:
                    helper.setText(R.id.tv_operate_type, "团队奖");
                    break;
                case 16:
                    helper.setText(R.id.tv_operate_type, "晋升奖");
                    break;
                case 17:
                    helper.setText(R.id.tv_operate_type, "1代复销奖");
                    break;
                case 18:
                    helper.setText(R.id.tv_operate_type, "报单收益");
                    break;
                case 19:
                    helper.setText(R.id.tv_operate_type, "区级分红收益");
                    break;
                case 20:
                    helper.setText(R.id.tv_operate_type, "BV返利");
                    break;
                case 21:
                    helper.setText(R.id.tv_operate_type, "股权分红");
                    break;
                case 22:
                    helper.setText(R.id.tv_operate_type, "平级奖");
                    break;
                case 23:
                    helper.setText(R.id.tv_operate_type, "小团队复销");
                    break;
                case 24:
                    helper.setText(R.id.tv_operate_type, "5-7代复销");
                    break;
                case 25:
                    helper.setText(R.id.tv_operate_type, "欧花兑换");
                    break;

            }
        }


        helper.setText(R.id.tv_order_seq, item.getCreated());
        if (item.getStype() == 0) {
            helper.setText(R.id.tv_operate_state, "+" + Utils.decimalUtils(item.getAmt(), 2));
        } else {
            helper.setText(R.id.tv_operate_state, "-" + Utils.decimalUtils(item.getAmt(), 2));
        }

    }


}
